package wms2010.gui.forms.disciplines;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.RemoteException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import wms2010.controller.controller.IDisciplineController;

@Component
public class DisciplineFormCreate extends AbstractDisciplineForm implements ActionListener{
	@Autowired
	private IDisciplineController disciplineController;
	
	public DisciplineFormCreate() {
		super();
		this.okButton.addActionListener(this);
	}

	public void actionPerformed(ActionEvent e) {
		try {
			this.disciplineController.createDiscipline(nameOfDiscipline.getText(), description.getText());
			System.out.println("created discipline");
		} catch (Exception e1) {
			e1.printStackTrace();
		}
	}
}
